<?php
            $this->headTitle($this->title);
?>
<br><br>
   <label><b>Please change your password</b></label><br><br>
<div id="message" class="error"><?php echo $this->message ?></div><br>
    <form name="password_form" id="password_form" action="<?php echo $this->url(array( 'controller' => 'process', 'action'     => 'changepassword'),'default', true) ?>" method="post">
      
        <table width="100%">
            <tbody>
                <tr>
                    <td width="40%" align="right">
                         <label>New Password: <img src="../images/redStar.gif"/></label>
                    </td>
                    <td width="50%" align="left">
                        <input type="password" name="password" id="password" size="30" value=""/>
                    </td>
                </tr>
                  <tr>
                    <td width="40%" align="right">
                         <label>Confirm Password: <img src="../images/redStar.gif"/></label>
                    </td>
                    <td width="50%" align="left">
                        <input type="password" name="confirmpassword" id="confirmpassword" size="30" value=""/>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <center><input type="submit" value="Submit" id="submit"/></center>
                    </td>
                </tr>
            </tbody>
        </table>
        <input type="hidden" name="action" value="_change"/>
</form>

<script>
$(document).ready(function(){
     $("#submit").click(function(){
                var valid =true;
                if ($.trim($("#password").val()) == "") {
                         $("#message").html("Password  is required");
                        valid= false;
		} else{
                     $("#message").html("");
                }
                 if ($.trim($("#confirmpassword").val()) == "") {
                         $("#message").html("Password  is required");
                        valid= false;
		} else{
                     $("#message").html("");
                }
                  if(!valid){
                    return false;
                }else{
                    $("form#password_form").submit();
                }

     });

});

</script>